﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChartSharp
{
    public class Chart : BaseChart
    {
        protected DataSets _dataSets;
        protected Colors _colors;
        protected Title _title;
        protected Legend _legend;

        public Chart(Type type)
            : base(type)
        {
        }

        public Chart(Type type, Size size)
            : base(type, size)
        {
        }

        public Chart(Type type, Size size, DataSets data)
            : base(type, size)
        {
            _dataSets = data;
        }

        public Chart Size(int width, int height)
        {
            base._size = new Size(width, height);
            return this;
        }

        public Chart Size(Size size)
        {
            base._size = size;
            return this;
        }

        public Chart DataSet(IEnumerable<IEnumerable<int>> dataSets)
        {
            _dataSets = new DataSets(dataSets);
            return this;
        }

        public Chart DataSet(IEnumerable<int> dataSet)
        {
            _dataSets = new DataSets(dataSet);
            return this;
        }

        public Chart DataSet(IEnumerable<IEnumerable<float>> dataSets)
        {
            _dataSets = new DataSets(dataSets);
            return this;
        }

        public Chart DataSet(IEnumerable<float> dataSet)
        {
            _dataSets = new DataSets(dataSet);
            return this;
        }

        public Chart DataSet(DataSets data)
        {
            _dataSets = data;
            return this;
        }

        public Chart Color(IEnumerable<string> colors)
        {
            _colors = new Colors(colors);
            return this;
        }

        public Chart Color(string color)
        {
            _colors = new Colors(color);
            return this;
        }

        public Chart Color(Colors colors)
        {
            _colors = colors;
            return this;
        }

        public Chart Title(string title)
        {
            _title = new Title(title);
            return this;
        }

        public Chart Title(string title, string color)
        {
            _title = new Title(title, color);
            return this;
        }

        public Chart Title(string title, string color, int size)
        {
            _title = new Title(title, color, size);
            return this;
        }

        public Chart Title(Title title)
        {
            _title = title;
            return this;
        }

        public Chart Legend(IEnumerable<string> legend)
        {
            _legend = new Legend(legend);
            return this;
        }

        public Chart Legend(Legend legend)
        {
            _legend = legend;
            return this;
        }
    }
}
